<html>
<head>
<title>codeAnywhere beta</title>
<link rel="stylesheet" type="text/css" href="stylesheets/openfiledialog.css"/>
<link rel="stylesheet" type="text/css" href="stylesheets/dialog.css"/>
<link rel="stylesheet" type="text/css" href="stylesheets/window.css"/>
<link rel="stylesheet" type="text/css" href="stylesheets/common.css"/>
<link rel="stylesheet" type="text/css" href="stylesheets/wikidialog.css"/>

<script language="javascript" type="text/javascript" src="scripts/dojo.js"></script>
<script language="javascript" type="text/javascript" src="scripts/json.js"></script>
<script language="javascript" type="text/javascript" src="scripts/ajax.js"></script>
<script language="javascript" type="text/javascript" src="scripts/common.js"></script>
<script language="javascript" type="text/javascript" src="scripts/component.js"></script>
<script language="javascript" type="text/javascript" src="scripts/navigate.js"></script>
<script language="javascript" type="text/javascript" src="scripts/file.js"></script>
<script language="javascript" type="text/javascript" src="scripts/menubar.js"></script>
<script language="javascript" type="text/javascript" src="scripts/selectNode.js"></script>
<script language="javascript" type="text/javascript" src="scripts/edit.js"></script>
<script language="javascript" type="text/javascript" src="scripts/console.js"></script>
<script language="javascript" type="text/javascript" src="scripts/compile.js"></script>
<script language="javascript" type="text/javascript" src="scripts/search.js"></script>
<script language="javascript" type="text/javascript" src="scripts/format.js"></script>
<script language="javascript" type="text/javascript" src="scripts/wiki.js"></script>
<script language="javascript" type="text/javascript" src="scripts/apisearch.js"></script>
<script language="javascript" type="text/javascript" src="scripts/help.js"></script>
<script language="javascript" type="text/javascript" src="scripts/system.js"></script>


<script language="javascript" type="text/javascript">
	dojo.require("dojo.io.*");
	dojo.require("dojo.widget.SplitContainer");
	dojo.require("dojo.widget.ContentPane");
	dojo.require("dojo.widget.TabContainer");
	dojo.require("dojo.widget.LinkPane");
	dojo.require("dojo.widget.Toolbar");
	dojo.require("dojo.widget.Menu2");
	dojo.require("dojo.widget.Editor");
	dojo.require("dojo.lang.*");
	dojo.require("dojo.widget.Tree");
	dojo.require("dojo.widget.TreeRPCController");
	dojo.require("dojo.widget.TreeSelector");
	dojo.require("dojo.widget.TreeNode");
	dojo.require("dojo.widget.TreeContextMenu");
	dojo.require("dojo.event.*");
	dojo.require("dojo.widget.Dialog");
	dojo.require("dojo.widget.Tooltip");
	
	/* for dialogs */
	dojo.require("dojo.widget.*");
	dojo.require("dojo.widget.TaskBar");
	dojo.require("dojo.widget.LayoutContainer");
	dojo.require("dojo.widget.FloatingPane");
	dojo.require("dojo.widget.ResizeHandle");
	/* end */

	dojo.hostenv.writeIncludes();
</script>

</head>

<body>

<!-- "TreeRPCController" -->
<div dojoType="TreeRPCController" RPCUrl="local" widgetId="treeController" DNDController="create"></div>
<div dojoType="TreeSelector" eventNames="select:nodeSelected" widgetId="treeSelector"></div>
			
<div dojoType="TreeContextMenu" toggle="explode" contextMenuForWindow="false" widgetId="treeContextMenu">
	<div dojoType="TreeMenuItem" treeActions="open" caption="Open" widgetId="treeContextMenuOpen"></div>
	<div dojoType="TreeMenuItem" treeActions="addChild" caption="Create" widgetId="treeContextMenuCreate"></div>
	<div dojoType="TreeMenuItem" treeActions="remove" iconSrc="icons/delete.gif" caption="Remove" widgetId="treeContextMenuRemove"></div>
	<div dojoType="TreeMenuItem" treeActions="rename" caption="Rename" widgetId="treeContextMenuRename"></div>
</div>
<!-- end -->

<div id="window" class="border window">
	<div id="titlebar" class="noborder titlebar"><div id="titlebartext" class="titlebartext">codeAnyehere - Untitled</div><div class="button close" onClick="OnQuit();"></div></div>
	<div id="menubar" class="noborder menubar" src="components/menubar.xml">
	</div>
	
	<div id="toolbar" class="noborder toolbar" src="components/toolbar.xml">
	</div>
	
	<div dojoType="SplitContainer"
		orientation="horizontal"
		sizerWidth="5"
		activeSizing="0"
		class="innercontainer noborder">
		
		<div id="navigator" class="noborder navigator" src="components/navigator.xml" dojoType="ContentPane" sizeShare="20">			
		</div>
		
		<div dojoType="SplitContainer"
			orientation="vertical"
			sizerWidth="5"
			activeSizing="0"
			sizeShare="60"
			class="innercontainer noborder">
			
			<div id="codearea" class="noborder codearea" src="components/codearea.xml" dojoType="ContentPane" sizeShare="50">		
			</div>
			<div id="console" class="border console" src="components/console.xml" dojoType="ContentPane" sizeShare="50">
			
			</div>
		</div>
		
	</div>
	<div id="infoBar" class="infobar">
		Please wait, processing...
	</div>
</div>

	<div dojoType="TaskBar" id="hiddentaskbar" hasShadow="true" resizable="false";
		style="width: 90%; height: 72px;margin: 0px; padding:0px; bottom: 30px; left: 5%; overflow: hidden; display: none;">
	</div>

<div dojoType="FloatingPane" id="newDialog" title="New Class" style="width: 300px; height: 200px; left: 300px; top: 100px; display: none;"
	hasShadow="true" resizable="false" displayMinimizeAction="true">
	<table>
		<tbody>
		<tr>
		<td>Class name: </td><td><input type="text" id="newclassname"></input></td>
		</tr>
		<tr>
		<td></td>
		<td>
			<input type="button" id="hider" value="New" onClick="OnNewButtonClick();dojo.widget.byId('newDialog').hide();"></input>
			<input type="button" id="cancler" value="Cancle" onClick="dojo.widget.byId('newDialog').hide();"></input>
		</td>
		</tr>
		</tbody>
	</table>
</div>

<div dojoType="FloatingPane" id="aboutDialog" title="About codeAnywhere" style="width: 320px; height: 240px; left: 300px; top: 100px; display: none;"
	hasShadow="true" resizable="true" displayMinimizeAction="true" toggle="fade" iconSrc="icons/aboutl.png">
	<img src="images/calogo.png"></img>
codeAnywhere - Online Development Tool
<br>
by Team Meta
<br>
<center><input type="button" id="oker" value="OK" onClick="dojo.widget.byId('aboutDialog').hide();"></input></center>
</div>

<div dojoType="FloatingPane" id="helpDialog" title="Help ?" style="width: 120px; height: 90px; float: right; display: none;"
	hasShadow="true" resizable="false" displayMinimizeAction="true" toggle="fade" iconSrc="icons/help.png">
	<a href="javascript:alert('How should I know?')" id="problem">Help to use</a>
</div>

<div dojoType="FloatingPane" id="loginDialog" title="Login" style="width: 300px; height: 200px; float: right; display: inline;"
	hasShadow="true" resizable="false" displayMinimizeAction="false" iconSrc="icons/login.png">
	<table>
		<tbody>
		<tr>
			<td>Username:</td><td><input type="text" id="username"></input></td>
		</tr>
		<tr>
			<td>Password:</td><td><input type="password" id="password"></input></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<input type="button" value="Login" onClick="doLogin();"></input>
				<input type="button" value="Register" onClick="OnRegister();"></input>
			</td>
		</tr>
		</tbody>
	</table>
</div>

<div dojoType="FloatingPane" id="registerDialog" title="Register" style="width: 300px; height: 200px; float: right; display: none;"
	hasShadow="true" resizable="false" displayMinimizeAction="false" iconSrc="icons/register.png">
	<table>
		<tbody>
		<tr>
		<td>Username: </td>
		<td><input type="text" id="usernameToR"></input></td>
		</tr>
		<tr>
		<td>Password: </td>
		<td><input type="password" id="passwordToR"></input></td>
		</tr>
		<tr>
		<td>Email: </td>
		<td><input type="text" id="emailToR"></input></td>
		</tr>
		<tr>
		<td></td>
		<td>
			<input type="button" value="Register" onClick="doRegister();"></input>
			<input type="button" value="Cancle" onClick="cancleRegister();"></input>
		</td>
		</tr>
		</tbody>
	</table>
</div>

<div dojoType="FloatingPane" id="quitDialog" title="Quit codeAnywhere" style="width: 300px; height: 200px; display: none;"
	hasShadow="true" resizable="false" displayMinimizeAction="true" displayCloseAction="false" toggle="fade">
	Do you really want to quit and save all the changes?
	<br>
	<input type="button" value="Quit" onClick="doQuit();"></input>
	<input type="button" value="Cancel" onClick="cancleQuit();"></input>
</div>

<div dojoType="FloatingPane" id="wikiDialog" title="Wiki - Development Source" style="width: 600px; height: 480px; display: none;"
	hasShadow="true" resizable="false" displayMinimizeAction="true" toggle="fade">
	<div id="searchtable" class="searchtable">
		<div id="searchinput" class="searchinput">
			<input type="text" id="wikitext"></input>
			<input type="button" id="searchbtn" value="Go" onClick="wikiSearch();"></input>
		</div>
		<div id="index" class="index"></div>
	</div>
	
	<div id="result" class="border result">
	</div>
</div>

<div dojoType="FloatingPane" id="apiDialog" title="API - Development Source" style="width: 600px; height: 480px; display: none;"
	hasShadow="true" resizable="false" displayMinimizeAction="true" toggle="fade">
	<div id="apisearchtable" class="searchtable">
		<div id="apisearchinput" class="searchinput">
			<input type="text" id="apiwikitext"></input>
			<input type="button" id="apisearchbtn" value="Go" onClick="DoAPISearch();"></input>
		</div>
		<div id="apiindex" class="index"></div>
	</div>
	
	<div id="apiresult" class="border result">
	<iframe id="resultframe" src="blank.html" style="width: 100%; height: 100%"></iframe>
	</div>
</div>

<div dojoType="FloatingPane" id="publicWikiDialog" title="Public the resource" style="width: 300px; height: 320px; display: none;"
	hasShadow="true" resizable="false" displayMinimizeAction="true" displayCloseAction="false" toggle="fade">
	<table>
		<tbody>
		<tr>
			<td>Tags(Seperated with comma):
			</td>
			<td>
				<input id="tags" type="text"></input>
			</td>
		</tr>
		<tr>
			<td>Source:
			</td>
			<td>
				<textarea id="sourcetopublic" rows="10", cols="20"></textarea>
			</td>
		</tr>
		
		</tbody>
	</table>
	<br>
	<input type="button" value="Publish" onClick="DoPublicWiki();"></input>
	<input type="button" value="Cancle" onClick="CanclePublicWiki();"></input>
</div>

</body>
<script language="javascript" type="text/javascript">
	initComponentById("menubar");
	initComponentById("toolbar");
	initComponentById("navigator");
	//initComponentById("openfile");
	
	var ca = new CodeArea("codearea");
	ca.init();
	
	console.write(INFO, "");
</script>
</html>
